import Vue from 'vue'
import Router from 'vue-router'
import Upload from '@/components/Upload'

import DashBoard from '@/pages/dashboard/DashBoard'
import StatisticsList from '@/pages/statistics/List'
import OrdersList from '@/pages/orders/List'
import AdminOrdersList from '@/pages/admin_orders/List'


import SuppliesIndex from '@/pages/supplies/Index'
import SuppliesList from '@/pages/supplies/List'
import SuppliesMyList from '@/pages/supplies/MyList'

import SuppliesEdit from '@/pages/supplies/Edit'

import StaffIndex from '@/pages/staff/Index'
import StaffList from '@/pages/staff/List'
import StaffEdit from '@/pages/staff/Edit'

import ThreadsIndex from '@/pages/threads/Index'
import ThreadsList from '@/pages/threads/List'
import ThreadsNewList from '@/pages/threads/NewList'


import ThreadsEdit from '@/pages/threads/Edit'

import CustomsIndex from '@/pages/customs/Index'
import CustomsList from '@/pages/customs/List'
import CustomsEdit from '@/pages/customs/Edit'

import StoresIndex from '@/pages/stores/Index'
import StoresList from '@/pages/stores/List'
import StoresEdit from '@/pages/stores/Edit'

import ShopsIndex from '@/pages/shops/Index'
import ShopsList from '@/pages/shops/List'
import ShopsEdit from '@/pages/shops/Edit'
import ShopsApplyList from '@/pages/shops/ApplyList'


import SchemasIndex from '@/pages/schemas/Index'
import SchemasList from '@/pages/schemas/List'
import SchemasEdit from '@/pages/schemas/Edit'
import SchemasView from '@/pages/schemas/View'

Vue.use(Router);

export default new Router({
  // mode: 'history',
  routes: [


    {
      path: '/schemas',
      component:SchemasIndex,
      children: [
        {
          path: '',
          name: 'schemasList',
          component: SchemasList
        },
        {
          path: 'add',
          name:'schemasAdd',
          component: SchemasEdit
        },
        {
          path: 'view/:id',
          name: 'schemasView',
          component: SchemasView
        },
        {
          path: ':id',
          name:'schemasEdit',
          component: SchemasEdit
        }

      ]

    },
    {
      path: '/',
      name: 'dashboard',
      component: DashBoard
    },
    {
      path: '/statistics',
      name: 'statistics',
      component: StatisticsList
    },

    {
      path: '/stores',
      component:StoresIndex,
      children: [
        {
          path: '',
          name: 'storesList',
          component: StoresList
        },
        {
          path: 'add',
          name:'storesAdd',
          component: StoresEdit
        },
        {
          path: ':id',
          name:'storesEdit',
          component: StoresEdit

        }

      ]

    },
    {
      path: '/customs',
      component:CustomsIndex,
      children: [
        {
          path: '',
          name: 'customsList',
          component: CustomsList
        },
        {
          path: 'add',
          name:'customsAdd',
          component: CustomsEdit
        },
        {
          path: ':id',
          name:'customsEdit',
          component: CustomsEdit

        }

      ]

    },

    {
      path: '/shops',
      component:ShopsIndex,
      children: [

        {
          path: '',
          name: 'shopsList',
          component: ShopsList
        },
        {
          path: 'applies',
          name:'shopsApplyList',
          component: ShopsApplyList
        },

        {
          path: 'add',
          name:'shopsAdd',
          component: ShopsEdit
        },
        {
          path: ':id',
          name:'shopsEdit',
          component: ShopsEdit
        },


      ]

    },

    {
      path: '/orders',
      name: 'orders',
      component: OrdersList
    },
    {
      path: '/admin_orders',
      name: 'admin_orders',
      component: AdminOrdersList
    },
    {
      path: '/supplies',

      component:SuppliesIndex,
      children: [
        {
          path: '',
          name: 'suppliesList',
          component: SuppliesList
        },
        // {
        //   path: 'my',
        //   name: 'suppliesMyList',
        //   component: SuppliesMyList
        // },
        {
          path: 'add',
          name:'suppliesAdd',
          component: SuppliesEdit
        },
        {
          path: ':id',
          name:'suppliesEdit',
          component: SuppliesEdit
        }

      ]

    },

    {
      path: '/staff',
      component:StaffIndex,
      children: [
            {
              path: '',
              name: 'staffList',
              component: StaffList
            },
            {
              path: 'add',
              name:'staffAdd',
              component: StaffEdit
            },
            {
              path: ':id',
              name:'staffEdit',
              component: StaffEdit
            }

          ]

    },
    {
      path: '/threads',
      component:ThreadsIndex,
      children: [
            {
              path: '',
              name: 'threadsList',
              component: ThreadsList
            },
            {
              path: 'add',
              name:'threadsAdd',
              component: ThreadsEdit
            },
            {
              path: 'new',
              name:'threadsNewList',
              component: ThreadsNewList
            },
            {
              path: ':id',
              name:'threadsEdit',
              component: ThreadsEdit
            }

          ]

    },
  ]
})
